using UnityEngine;

namespace dkdm.danmuhelper
{
    [DisallowMultipleComponent]
    public class HierachyCommentComponent : MonoBehaviour, IHierarchyComment, IHierarchyBackgroundColor, IHierarchyBackgroundTexture
    {
        [SerializeField]
        [Header("节点注释")]
        private string _hierachyComment = "This is a comment";

        public string HierachyComment => _hierachyComment;

        [SerializeField]
        [Header("节点背景颜色")]
        private Color _bgColor = new Color(0.5f, 0.5f, 0.5f, 0.5f);

        [SerializeField]
        [Header("节点背景图片")]
        private Texture2D _bgTexture;

        [SerializeField]
        [Header("节点背景材质")]
        private Material _bgMaterial;

        [SerializeField]
        [Header("节点背景缩放模式")]
        private ScaleMode _bgScaleMode;

        [SerializeField]
        [Header("节点背景图片宽高比")]
        private float _bgImageAspect = 1f;

        Color IHierarchyBackgroundColor.Color => _bgColor;

        Texture2D IHierarchyBackgroundTexture.Texture => _bgTexture;

        Material IHierarchyBackgroundTexture.Material => _bgMaterial;

        ScaleMode IHierarchyBackgroundTexture.ScaleMode => _bgScaleMode;

        float IHierarchyBackgroundTexture.ImageAspect => _bgImageAspect;
    }
}
